{% extends "base.html" %}
{% block title %}修改分类{% endblock %}
{% block navbar %}{{ super() }}{% endblock %}
{% block styles %}{{ super() }}
<style>
    .main-div {
        background: #ffffff none repeat scroll 0 0;
        border-radius: 2px;
        margin: 10px auto 30px;
        max-width: 80%;
        padding: 20px 20px 20px 20px;
    }

    body {
        padding-top: 100px;
    }
</style>
{% endblock %}
{% block content %}
<div class="container">
    <div class="row">
        <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
        <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10">
            {% include 'flash_message.html' %}
            <form action="{{ url_for('bp_admin.admin_subcategory_edit', subcategoryid=subcategory[0] ) }}"
                method="POST">
                <div class="form-group">
                    <label for="categoryid">大类</label>
                    <select class="selectpicker form-control" name="categoryid" title="选择大类" data-show-subtext="true"
                        data-live-search="true">
                        {% for category in categories %}
                        {% if category[0] == subcategory[3] %}
                        <option value="{{ category[0] }}" selected="selected">{{ category[1] }}</option>
                        {% else %}
                        <option value="{{ category[0] }}">{{ category[1] }}</option>
                        {% endif %}
                        {% endfor %}
                    </select>
                </div>
                <div class="form-group">
                    <label for="name">分类</label>
                    <input type="text" name="name" class="form-control" value="{{ subcategory[1] }}">
                </div>
                <div class="form-group">
                    <label for="color">颜色</label>
                    <input type="text" name="color" class="form-control jscolor" value="{{ subcategory[2] }}">
                </div>
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>
        </div>
        <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
    </div>
</div>
{% endblock %}